package com.ruoyi.cash.domain.valueobject.trading.types;

/**
 * @name: OrderType
 * @author: LZQ
 * @date: 2024-10-27
 * @time: 22:34
 * @project_name: RuoYi-Vue
 * @description:
 */
public enum TradingType {
    WX(1, "微信"),
    XJ(3, "现金"),
    YH(4, "银行"),
    JF(5, "积分"),
    ZFB(2, "支付宝");

    private Integer code;
    private String desc;

    TradingType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static boolean isExist(Integer code) {
        for (TradingType tradingType : TradingType.values()) {
            if (tradingType.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }

    public static boolean isEqual(TradingType code, TradingType code2) {
        return code.equals(code2);
    }


}
